﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LMKJ.Classes;
using System.Web.Security;

namespace LMKJ
{
    public partial class profile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] != null)
            {
                SocialWorker user = (SocialWorker)Session["User"];
                swIDLbl.Text = user.Sw_id.ToString();
                usernameLbl.Text = user.Username;
                nameLbl.Text = user.Name;
                dobLbl.Text = user.Dob;
                emailLbl.Text = user.Email;
                genderLbl.Text = user.Gender;
                joinDateLbl.Text = user.Joined_date;
            }
            else
            {
                FormsAuthentication.SignOut();
                Response.Redirect("default.aspx");
            }
        }

        protected void editProfileBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("editprofile.aspx");
        }

        protected void logoutBtn_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            FormsAuthentication.SignOut();
            Response.Redirect("default.aspx");
        }
    }
}